<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>后台登录</title>
	<meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />

	<link rel="stylesheet" href="/css/xadmin.css">
    <script type="text/javascript" src="/js/jquery-3.1.1.min.js"></script>
    <script type="text/javascript" src="/js/vue.js"></script>


</head>
<body class="login-bg">
    
    <div class="login" id="login">
        <div class="message">用户登录</div>
        <div id="darkbannerwrap"></div>

        
		<hr class="hr15">
       
        <form id="user" >
            <input name="username" placeholder="用户名" v-model="user.username"  type="text" class="layui-input" >
            <hr class="hr15">
            <input name="password"   v-model="user.password" placeholder="密码"  type="password" >
            <hr class="hr15">
            <input value="登录"  @click="login()" style="width:100%;" type="button">
            <a  th:href="@{/user/login1Page}">邮箱登录</a>
            <hr class="hr20" >
        </form>


    </div>

<script>
    new Vue({
        el:"#login",
        data:{
            user:{
                username:"",
                password:"",
            }
        },
        methods:{
            login:function () {
                var self = this;
                $.ajax({
                    url:"/userReful/login",
                    type:"post",
                    contentType:"application/x-www-form-urlencoded",
                    data:self.user,
                    dataType:"json",
                    success:function (data) {
                        console.log(data);
                        alert(data.info);
                        if(data.info=="登录成功"){
                            window.location.href="/user/indexPage";
                        }
                    }


                })

            }

        }

    })
</script>

</body>
</html>